//
//  BaseViewController.h
//  NBProduct
//
//  Created by ping on 15/8/19.
//  Copyright (c) 2015年 ping. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>

@interface BaseViewController : UIViewController<UIAlertViewDelegate,UIWebViewDelegate>
{
    float _kscH;
    float _kscW;
}
-(void)drawView;
-(void)drawBackButton;
-(void)drawBackButtonTwo;
-(void)drawBackTiShiButton;
-(void)drawNavWithTitle:(NSString *)Title;
-(void)drawNavWithTitle:(NSString *)Title WithColor:(UIColor*)color;
-(void)ksc;

-(void)requestData;
-(UIImage *) getImageFromURL:(NSURL*)url;
-(NSString *)defaultLoadlongitude;
-(NSString *)defaultLoadPortrait;
-(NSString *)defaultLoadUserName;
-(NSString *)defaultLoadlatitude;
-(NSString *)defaultLoadcityname;
-(NSString *)defaultLoadisRegistXiaoQu;


//用户选择的小区
-(void)defaultSaveXiaoQuName:(NSString*)a;
-(void)defaultSaveXiaoQuId:(NSString *)a;
-(void)defaultSaveFangWuAddress:(NSString*)a;
-(void)defaultSaveYeZhuFangHao:(NSString*)a;
-(void)defaultSaveIsXiaoQuYeZhu:(NSString*)a;

-(NSString *)returnTimeWithString:(NSString *)createdTime andGeshi:(NSString *)fomatter;

-(NSString *)defaultLoadXiaoQuName;
-(NSString *)defaultLoadXiaoQuId;
-(NSString *)defaultLoadFangWuAddress;
-(NSString *)defaultLoadFangHao;
-(NSString *)defaultLoadIsXiaoQuYeZhu;

-(NSAttributedString *)returnPriceStr:(NSString *)price;
-(NSAttributedString *)returnCellText:(NSString *)text AndNumStr:(NSString *)numStr andPingfenColor:(UIColor *)pColor andOtnerColor:(UIColor *)otherColor;
//token
-(NSString *)defaultLoadTokenId;
-(void)defaultSaveTokenId:(NSString*)a;
- (NSString*)weekDayStr:(NSString *)format;
-(NSString *)defaultTuiJianRenId;
-(void)defaultSaveTuiJianRenId:(NSString*)a;

-(NSString *)defaultGongNengBiaoJi;
-(void)defaultSaveGongNengBiaoJi:(NSString*)a;

-(NSString *)defaultLonginType;
-(void)defaultSaveLonginType:(NSString*)a;

-(NSAttributedString *)returnPriceStr:(NSString *)price andOldPrice:(NSString *)oldPrice;
//返回字符的高度
-(CGSize)setFrame:(NSString *)text fontSize:(CGFloat)size andBiggestWidth:(CGFloat)width;
//返回回复的NSAttributedString
-(NSAttributedString *)returnCellText:(NSString *)nameStr anwserName:(NSString *)anwserName andAnwserText:(NSString *)anwsetText;
-(NSString *)defaultLoadcityCode;

-(void)defaultSavecityCode:(NSString*)a;

-(NSString *)defaultLoadcityId;
-(void)defaultSavecityName:(NSString*)a;
-(void)defaultSavePortrait:(NSString*)a;
-(void)defaultSaveUserName:(NSString*)a;
-(void)defaultSavecity:(NSString*)a;
-(void)defaultSavelongitude:(NSString*)a;
-(void)defaultSavelatitude:(NSString*)a;
-(void)defaultSaveUserIsRegistXiaoQu:(NSString*)a;


-(NSString *)defaultBirthday;
-(void)defaultSaveBirthday:(NSString*)a;

//昵称
-(NSString *)defaultNiCheng;
-(void)defaultSaveNiCheng:(NSString*)a;

//手机
-(NSString *)defaultPhone;
-(void)defaultSavePhone:(NSString*)a;
-(BOOL)jianCePhone;//检测是否绑定手机(小区)

//默认地址
-(NSString *)defaultMoRenAddressId;
-(void)defaultSaveMoRenAddressId:(NSString*)a;
//uid
-(NSString *)defaultUserId;
-(void)defaultSaveUserId:(NSString*)a;

//图片长宽比
-(NSString *)defaultImageLong;
-(void)defaultSaveImageLong:(NSString*)a;
-(NSString *)defaultImageWidth;
-(void)defaultSaveImageWidth:(NSString*)a;

-(BOOL)jianCeLogin;

-(NSURL *)returenUrlWithStr:(NSString *)str;

//商户
-(NSString *)defaultShangHuId_chongYin;
-(void)defaultSaveShangHuId_chongYin:(NSString*)a;

-(NSString *)defaultChanPinId_chongYin;
-(void)defaultSaveChanPinId_chongYin:(NSString*)a;

-(NSString *)defaultPeiZhiId_chongYin;
-(void)defaultSavePeiZhiId_chongYin:(NSString*)a;
//人人快递个人信息


//支付区别
-(NSString *)defaultZhiFuType;
-(void)defaultSaveZhiFuType:(NSString*)a;

-(NSString *)returnNoNullStrWith:(NSString *)str;

//充值手机号记录
-(NSArray *)defaultChongZhiPhone;
-(void)defaultSaveChongZhiPhone:(NSArray*)a;

-(NSArray *)defaultShangChengSouSuoJiLU;
-(void)defaultSaveShangChengSouSuoJiLU:(NSArray*)a;

//时间戳变换
-(NSString *)createdAt:(NSString *)createdTime;
//返回剩余时间戳
-(long long)returnShenYuTimeWith:(long long)endTimes;

//临时会话
- (void)onOpenWPA;

- (BOOL)isMobileNumber:(NSString *)mobileNum;

//md5 32Bit
- (NSString *)md5:(NSString *)str;

//查询用户夺宝币
- (void)duoBaoBiChaXunanBlock:(void(^)(NSDictionary * count))block;

//分享图片剪切
- (UIImage *)thumbImageWithImage:(UIImage *)scImg limitSize:(CGSize)limitSize;

//返回头像地址
-(NSString *)returenHeaderImageStrWith:(NSString *)headerStr;

//支付宝支付
-(void)zhiFuZhiFuBaoWith:(NSString *)tradeNO and:(NSString *)productName and:(NSString*)productDescription and:(float)amount andType:(NSString *)type andCount:(NSString *)count anBlack:(void(^)(NSDictionary * resultDic))block;

- (void)sendPay_demoWith:(NSDictionary *)dict;

-(NSString *)returnDinDanNumWithType:(NSString *)type andIdStr:(NSString *)idStr andPrice:(NSString *)price;

//支付
//-(void)zhiFuWith:(NSString *)orderNO andCount:(float)amount andDisplay:(NSArray *)extra andSearchUrl:(NSString *)seaverURL anBlock:(void(^)(NSString *result,PingppError *error))block;
-(UIColor *)typeColor:(NSString *)typeStr;
-(void)yangCheDrawNavWithTitle:(NSString *)Title WithColor:(UIColor*)color;

-(UIBarButtonItem *)drawKuaiDiBackButton;
-(BOOL)isBetweenEightAndTen;
-(NSTimeInterval)returnTimeWithString:(NSString *)dateStr;
@end
